#include <iostream>
using namespace std;

void mkheap(int a[], int n);
void adjust_down(int a[], int beg, int lim);
void heap_sort(int a[], int n);
void print(int a[], int n);
inline void swap(int &a, int &b) { int tmp = a; a = b; b = tmp; }

int main(int argc, char *argv[])
{
    //int a[] = {5,4,3,7,2,8,0,12,1};
    int a[] = {2,1};
    int n = sizeof(a)/sizeof(a[0]);
    print(a, n);
    heap_sort(a, n);
    //mkheap(a,n);
    print(a, n);
    return 0;
}

